package com.sljy.hzk.room.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.sljy.hzk.entity.DangerDatabaseEntity;
import com.sljy.hzk.entity.TaskDatabaseEntity;

import java.util.List;

/**
 * Created  on 2018/7/10 0010
 *
 * @author 唐开阔
 * @describe
 */
@Dao
public interface DangerDao {
    /**
     * 添加一个数据
     */
    @Insert
    void insert(DangerDatabaseEntity userEntity);

    @Update
    void update(DangerDatabaseEntity userEntity);

    @Delete
    void delete(DangerDatabaseEntity userEntity);

    @Query("SELECT  * FROM DangerDatabaseEntity where isFinsh = :isFinsh")
    List<DangerDatabaseEntity> get(boolean isFinsh);

    @Query("SELECT  * FROM DangerDatabaseEntity where userId = :userId")
    List<DangerDatabaseEntity> getById(String userId);

    @Query("SELECT  * FROM DangerDatabaseEntity where id = :id")
    DangerDatabaseEntity getById(int id);

    @Query("SELECT  * FROM DangerDatabaseEntity")
    List<DangerDatabaseEntity> get();
}
